<template>
  <div v-loading="loading">
    <el-carousel
      trigger="click"
      height="180px"
    >
      <el-carousel-item
        v-for="item in 3"
        :key="item"
      >
        <el-image
          :src="'/bg/'+item+'.jpg'"
          fit="cover"
          style="height:100%;width:100%;"
        ></el-image>
      </el-carousel-item>
    </el-carousel>
    <!-- <div style="margin-top:10px;text-align:right">
      <el-button
        type="primary"
        @click="getData"
      >刷新</el-button>
    </div>
    <el-row
      :gutter="20"
      style="margin-top:10px"
    >
      <el-col :span="24">
        <el-card class="box-card">
          <div style="font-size:24px">今日新增发票<span style="margin:0 10px;color:#F56C6C">{{summary.invoiceTotal}}</span>张，成功<span style="margin:0 10px;color:#F56C6C">{{summary.invoiceSuccess}}</span>张，失败<span style="margin:0 10px;color:#F56C6C">{{summary.invoiceFail}}</span>张</div>
        </el-card>
      </el-col>
      <el-col :span="24" style="margin-top:10px">
        <el-card class="box-card">
          <div style="font-size:24px">今日新增客户<span style="margin:0 10px;color:#F56C6C">{{summary.customerTotal}}</span>个，审批状态异常客户 <span
              style="margin:0 10px;color:#F56C6C;cursor:pointer;"
              @click="openExamineStatusExceptionListDialog"
            >{{summary.examineStatusExceptionCustomerTotal}}</span> 个，今日重复客户 <span
              style="margin:0 10px;color:#F56C6C;"
            >{{summary.customerRepeatTotal}}</span> 个，中文<span
              style="margin:0 10px;color:#F56C6C;"
            >{{summary.customerZhRepeatTotal}}</span> 个</div>
        </el-card>
      </el-col>
    </el-row>
    <examine-status-exception-list-dialog ref="examineStatusExceptionListDialog" /> -->
    <!-- <el-button @click="test">test</el-button> -->
  </div>
</template>
<script>
import api from "@/api/home"
import examineStatusExceptionListDialog from "@/components/crm/customer/examineStatusExceptionListDialog";

export default {
  components: {
    examineStatusExceptionListDialog,
  },
  name: "index",
  data() {
    return {
      loading: false,
      summary: {}
      // homeStatistic: {
      //   followUpBusinessAmount: 0,
      //   newBusinessAmount: 0,
      //   newCustomerAmount: 0,
      //   newEmployeeAmount: 0,
      //   toApprovalAmount: 0,
      //   regularEmployeeAmount: 0,
      //   expireRegularEmployeeAmount: 0,
      //   dimissionEmployeeAmount: 0,
      //   expireQualificationAmount: 0,
      //   outCarAmount: 0,
      //   notices: []
      // }
    };
  },
  created() {
    // this.getData();
  },
  methods: {
    test() {
      this.$router.push("/sys/user?a=b");
      console.log(this.$router);
    },
    getData() {
      this.loading = true;
      api.getTodaySummary().then(res => {
        this.summary = res.data;
        this.loading = false;
      })
    },
    openExamineStatusExceptionListDialog() {
      this.$refs.examineStatusExceptionListDialog.open();
    }
  }
};
</script>